let app = getApp<IAppOption>();
let util = require("@/utils/util");
Page({
  data: {
    scrollHeight: "100vh",
    placeholder: "秋冬新品",
    tabData: [
      { text: "推荐" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
      { text: "服装" },
    ] as TabBarFrame[],
    pageData: {
      imageLink: {
        pageUrl: "/pages/test/test",
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/shop_front/tuijian/10001.jpg",
      },
      gridLink: {
        items: [
          {
            imageUrl:
              "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/shop_front/tuijian/10002.jpg",
            pageUrl: "/pages/test/test",
            text: "新人福利",
          },
          {
            imageUrl:
              "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/shop_front/tuijian/10002.jpg",
            pageUrl: "/pages/test/test",
            text: "新人福利",
          },
          {
            imageUrl:
              "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/shop_front/tuijian/10002.jpg",
            pageUrl: "/pages/test/test",
            text: "新人福利",
          },
          {
            imageUrl:
              "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/shop_front/tuijian/10002.jpg",
            pageUrl: "/pages/test/test",
            text: "新人福利",
          },
          {
            imageUrl:
              "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/shop_front/tuijian/10002.jpg",
            pageUrl: "/pages/test/test",
            text: "新人福利",
          },
          {
            imageUrl:
              "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/shop_front/tuijian/10002.jpg",
            pageUrl: "/pages/test/test",
            text: "新人福利",
          },
          {
            imageUrl:
              "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/shop_front/tuijian/10002.jpg",
            pageUrl: "/pages/test/test",
            text: "新人福利",
          },
          {
            imageUrl:
              "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/shop_front/tuijian/10002.jpg",
            pageUrl: "/pages/test/test",
            text: "新人福利",
          },
          {
            imageUrl:
              "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/shop_front/tuijian/10002.jpg",
            pageUrl: "/pages/test/test",
            text: "新人福利",
          },
          {
            imageUrl:
              "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/shop_front/tuijian/10002.jpg",
            pageUrl: "/pages/test/test",
            text: "新人福利",
          },
        ],
      } as GridLink,
    } as PageData,
    tuijianProductList: [
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/300_wKgBZWhwzFiAcsCIAAFD1VdS4OY196.jpg",
        title: "Hugo Boss",
        price: 1888,
        pageUrl: "/pages/test/test",
      },
    ] as ProductLink[],
    productList: [
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/7f5d3b54a2f9cafdb3ef135c4857bcb7.jpg",
        title: "Hugo Boss",
        price: 1888,
        originalPrice: 888,
        self: true,
        buyCount: 10,
        like: false,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/7f5d3b54a2f9cafdb3ef135c4857bcb7.jpg",
        title: "Hugo Boss",
        price: 1888,
        originalPrice: 888,
        like: true,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/7f5d3b54a2f9cafdb3ef135c4857bcb7.jpg",
        title: "Hugo Boss",
        price: 1888,
        originalPrice: 888,
        self: true,
        buyCount: 10,
        like: false,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/7f5d3b54a2f9cafdb3ef135c4857bcb7.jpg",
        title: "Hugo Boss",
        price: 1888,
        originalPrice: 888,
        self: true,
        pageUrl: "/pages/test/test",
      },
      {
        imageUrl:
          "https://shop-bucket-w.oss-cn-beijing.aliyuncs.com/image/7f5d3b54a2f9cafdb3ef135c4857bcb7.jpg",
        title: "Hugo Boss",
        price: 1888,
        originalPrice: 888,
        self: true,
        buyCount: 10,
        like: false,
        pageUrl: "/pages/test/test",
      },
    ] as ProductLink[],
  },
  tabtap(e: TabTapEvent) {
    console.log(e.detail);
  },
  tuijianProductTap(e: WechatMiniprogram.TouchEvent) {
    console.log("tuijianProductTap", e.target.dataset.index);
  },
  onReady() {
    app.getNavBarHeight().then((navBarHeight) => {
      const systemInfo = wx.getSystemInfoSync();
      let scrollHeight =
        systemInfo.screenHeight - navBarHeight - util.rpxToPx(180) - 80;
      this.setData({ scrollHeight: scrollHeight + "px" });
    });
  },
});
